<?php 
class IntroModel extends Model
{
	//设置表名
	protected $trueTableName = 'cmp_intro';
	
	//设置主键
	protected  $key = 'cmp_id';
	
		/**
		 * 更新一条数据
		 */
		public function update(array $data, $id)
		{
		
			//字段
			$field = array(
					'*',
			);
		
			//字段过滤
			//$data = $this->CheckField($data, $field);
				
			//条件
			$where = $this->key.'='.$id;

			return $this->where($where)->save($data);
				
		}
		/**
		 * 通过ID 获取一条数据
		 * @param unknown $id 主键ID
		 * @return Ambigous <mixed, boolean, NULL, multitype:, unknown, string>
		 */
		public function getRowById($id)
		{
				
			//字段
			$field = array(
		
					'*',
		
			);
		
			//条件
			$where = $this->key."=".$id;
				
			return $this->field($field)->where($where)->find();
				
		}
}

?>